package com.yuanfeng.payment.feign;

import com.yuanfeng.commoms.dto.base.MemberMessageListIntegralDTO;
import com.yuanfeng.commoms.dto.userms.UserPointLogDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;


@FeignClient(name = "mall-userms", url = "http://localhost:8081")
public interface UsermsServiceClient {

    /**
     * feign 根据用户id 查询当前用户有多少积分
     *
     * @param userId
     * @return
     */
    @PostMapping("/user/ms/getMemberIntegralByUserId")
    Integer getMemberIntegralByUserId(@RequestParam("userId") String userId);

    /**
     * 开通plus会员
     * @param map
     * @return
     */
    @PostMapping(value = "user/plusInfo/plusMember/openMember")
    public ResponseResult plusmemberopen(@RequestBody Map<String,Object> map);

    /**
     * 修改用户积分
     *
     * @param param
     * @return
     */
    @PostMapping("/user/ms/updateMemberIntegral")
    ResponseResult updateMemberIntegral(@RequestBody MemberMessageListIntegralDTO param);

    /**
     * 修改用户积分
     *
     * @param param
     * @return
     */
    @PostMapping("/user/ms/fegin/addPointsLog")
    ResponseResult feginAddpointsLog(@RequestBody UserPointLogDTO param);

    /**
     * 修改用户积分
     *
     * @param map
     * @return
     */
    @PostMapping("/user/pointsLog/insertByMap")
    ResponseResult insertPointLogByMap(@RequestBody Map<String, Object> map);
}
